From 786d800f61e25a1892c44f68a3e21c0507d03a1d Mon Sep 17 00:00:00 2001 From: Justin Burkett Date: Mon, 5 Dec 2016 14:09:36 -0500 Subject: [PATCH] Prevent display from occurring twice in a row Found some cases where this could happen with a secondary idle delay. --- which-key.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/which-key.el b/which-key.el index 84beedace6b..c8a08295c5f 100644 --- a/which-key.el +++ b/which-key.el @@ -2171,12 +2171,13 @@ Finally, show the buffer." (bound-and-true-p god-local-mode) (eq this-command 'god-mode-self-insert)) (null this-command))) - (when (or (null which-key-delay-functions) - (null (setq delay-time (run-hook-with-args-until-success - 'which-key-delay-functions - (key-description prefix-keys) - (length prefix-keys)))) - (sit-for delay-time)) + (when (and (not (equal prefix-keys which-key--current-prefix)) + (or (null which-key-delay-functions) + (null (setq delay-time (run-hook-with-args-until-success + 'which-key-delay-functions + (key-description prefix-keys) + (length prefix-keys)))) + (sit-for delay-time))) (which-key--create-buffer-and-show prefix-keys) (when (and which-key-idle-secondary-delay (not which-key--secondary-timer-active)) -- 2.30.2